class AlertModel {
  List<Alert>? alert;

  AlertModel({this.alert});

  AlertModel.fromJson(Map<String, dynamic> json) {
    if (json['alert'] != null) {
      alert = <Alert>[];
      json['alert'].forEach((v) {
        alert!.add(new Alert.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.alert != null) {
      data['alert'] = this.alert!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Alert {
  String? alertName;
  DateTime? alertAt;
  String? reason;

  Alert({this.alertName, this.alertAt, this.reason});

  Alert.fromJson(Map<String, dynamic> json) {
    alertName = json['alertName'];
    alertAt =
        json['alertAt'] != null ? DateTime.tryParse(json['alertAt']) : null;
    reason = json['reason'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['alertName'] = this.alertName;
    data['alertAt'] = this.alertAt;
    data['reason'] = this.reason;
    return data;
  }
}
